<template>
    <div class="container">
        <div class="title">默认插槽:</div>
        <slot></slot>
    </div>

    <div class="container">
        <div class="title">具名插槽</div>
        <slot name="content"></slot>
    </div>

    <div class="container">
        <div class="title">作用域插槽</div>
        <slot name="actions" :items="list">
        </slot>
    </div>

</template>

<script setup lang="ts">
const {list} = defineProps<{list: string[]}>();
</script>

<style lang="scss" scoped>
.container {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    padding: 2rem;
    margin: 1rem 0;
    border-radius: 1rem;
}
.title {
    margin-right: 1rem;
    font-weight: bold;
}
</style>
